package com.google.code.hibernate.rest.internal;


/**
 * 
 * @author wangzijian
 * 
 */
public class InternalPreconditions {

	private InternalPreconditions() {

	}

	public static void checkState(boolean expression, Object errorMessage) {
		if (!expression) {
			throw new IllegalStateException(String.valueOf(errorMessage));
		}
	}

	public static <T> T checkNotNull(T reference, Object errorMessage) {
		if (reference == null) {
			throw new NullPointerException(String.valueOf(errorMessage));
		}
		return reference;
	}
}
